﻿using Games.Basic;
using Games.Common;
using Xamarin.Forms;

namespace Games.DigitalSame
{
    class GameInfo : BaseViewModel, IGameInfo
    {
        public string Name => "数同";
        public string Desc => "数同是一个益智小游戏，可以训练逻辑推理能力。" +
            "\r\n\r\n点击一个格子，该格子和其上下左右的数字都会增加1，每个格子有1-9九种状态，当所有格子数字都一样时完成游戏。";
        public string Version => "1.0";
        public string ID => "E48BE069-7EB2-404D-B179-408C9D794C04";
        public string BuildDate => "20201225";
        public ContentPage NewPage() => PageHolder.Get(() => new GamePage(this));

        public int AllCount
        {
            get { return this.width * this.height; }
        }

        int clickCount = 0;
        public int ClickCount
        {
            get { return clickCount; }
            set { SetProperty(ref clickCount, value); }
        }

        private int width;
        private int height;
        public int Width
        {
            get
            {
                return width;
            }
            set
            {
                SetProperty(ref width, value);
                OnPropertyChanged("AllCount");
                OnPropertyChanged("Size");
            }
        }
        public int Height
        {
            get
            {
                return height;
            }
            set
            {
                SetProperty(ref height, value);
                OnPropertyChanged("AllCount");
                OnPropertyChanged("Size");
            }
        }

        public string Size { get { return $"{this.width}*{this.height}"; } }

        //private bool isRandomBright;
        //private bool isRandomEmpty;
        //public bool IsRandomBright { get => this.isRandomBright; set => SetProperty(ref isRandomBright, value); }
        //public bool IsRandomEmpty { get => this.isRandomEmpty; set => SetProperty(ref isRandomEmpty, value); }
    }
}